﻿using System.Threading.Tasks;
using Yun.Sys.Api.Contracts.Domain.Module;
using ZhonTai.Admin.Core.Configs;
using ZhonTai.Admin.Core.Db.Data;

namespace Yun.Sys.Api.Repositories
{
    public class CustomGenerateData : GenerateData, IGenerateData
    {
        public virtual async Task GenerateDataAsync(IFreeSql db, AppConfig appConfig)
        {
            var isTenant = appConfig.Tenant;

            var modules = await db.Queryable<ModuleEntity>().ToListAsync();

            SaveDataToJsonFile<ModuleEntity>(modules, isTenant, path: "InitData/App");
        }
    }
}
